import Database from "better-sqlite3";

export const initDB = async () => {
  const db = new Database("./db.sqlite");

  db.exec(`
    CREATE TABLE IF NOT EXISTS textItem (
      id INTEGER PRIMARY KEY AUTOINCREMENT,
      title TEXT NOT NULL,
      description TEXT,
      isDeleted INTEGER DEFAULT 0
    )
  `);

  return db;
};
